11baf3
@@ -248,7 +248,7 @@
public class ProtobufLogReader extends ReaderBase {
               + posBefore + " and read up to " + posAfterStr;
           IOException realEofEx = extractHiddenEof(ex);
           throw (EOFException) new EOFException("EOF " + message).
-              initCause(realEofEx != null ? ex : realEofEx);
+              initCause(realEofEx != null ? realEofEx : ex);
         }
         if (trailerPresent && this.inputStream.getPos() > this.walEditsStopOffset) {
           LOG.error("Read WALTrailer while reading WALEdits. hlog: " + this.path
